package com.hutianao.gqgl.user.entity;

import com.hutianao.gqgl.mybatis.entity.PtUserEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class SecurityUser extends User {
    public SecurityUser(String username, String password, PtUserEntity ptUserEntity, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.userUuid = ptUserEntity.getUserUuid();
        this.email = ptUserEntity.getEmail();
        this.mobile = ptUserEntity.getMobile();
        this.niceName = ptUserEntity.getNiceName();

    }
    /**
     * 用户编码
     */
    private String userUuid;
    /**
     * 邮件地址
     */
    private String email;
    /**
     * 电话
     */
    private String mobile;
    /**
     * 真实姓名
     */
    private String niceName;

    public String getUserUuid() {
        return userUuid;
    }

    public void setUserUuid(String userUuid) {
        this.userUuid = userUuid;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNiceName() {
        return niceName;
    }

    public void setNiceName(String niceName) {
        this.niceName = niceName;
    }

    @Override
    public String toString() {
        return "SecurityUser{" +
                "userUuid='" + userUuid + '\'' +
                ", email='" + email + '\'' +
                ", mobile='" + mobile + '\'' +
                ", niceName='" + niceName + '\'' +
                '}';
    }
}
